<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="title">
        Messages
    </ui:define>

    <ui:define name="description">
        Messages components are used to display FacesMessages.
    </ui:define>

    <ui:param name="documentationLink" value="/components/messages" />

    <ui:define name="implementation">

        <p:tooltip />

        <h:form>
            <p:messages id="messages" showDetail="true" closable="true">
                <p:autoUpdate />
            </p:messages>

            <p:commandButton value="Info" action="#{messagesView.info}" />
            <p:commandButton value="Warn" action="#{messagesView.warn}" />
            <p:commandButton value="Error" action="#{messagesView.error}" />
            <p:commandButton value="Fatal" action="#{messagesView.fatal}" />
        </h:form>

        <p:separator />

        <h:form>
            <h:panelGrid id="grid" columns="3" cellpadding="5">
                <p:outputLabel for="default" value="Default:" />
                <p:inputText id="default" required="true" />
                <p:message for="default" />

                <p:outputLabel for="txt" value="Text:" />
                <p:inputText id="txt" required="true" />
                <p:message for="txt" display="text" />

                <p:outputLabel for="icon" value="Icon:" />
                <p:inputText id="icon" required="true" />
                <p:message for="icon" display="icon" />

                <p:outputLabel for="tt" value="Tooltip:" />
                <p:inputText id="tt" required="true" />
                <p:message for="tt" display="tooltip" />
            </h:panelGrid>

            <p:commandButton id="submitButton" value="Submit" update="grid" />
        </h:form>

    </ui:define>

</ui:composition>